import { ParameterType } from "../stores/glyph"
const xHeight = 500
const ascender = 800
const capitalHeight = 750
const width = 360
const descender = -200
const serifSize = 2.0

let lowercaseLetters = [
  {
    name: 'a',
    params: [
      {
        name: 'h1',
        value: xHeight,
        min: 0,
        max: 1000,
        step: 1,
        default: xHeight,
      },
      {
        name: 'h2',
        value: 100,
        min: 0,
        max: 1000,
        step: 1,
        default: 100,
      },
      {
        name: 'h3',
        value: xHeight * 282 / 500,
        min: 0,
        max: 1000,
        step: 1,
        default: xHeight * 282 / 500,
      },
      {
        name: 'h4',
        value: 85,
        min: 0,
        max: 1000,
        step: 1,
        default: 85,
      },
      {
        name: 'h5',
        value: 118,
        min: 0,
        max: 1000,
        step: 1,
        default: 118,
      },
      {
        name: 'w1',
        value: width,
        min: 0,
        max: 1000,
        step: 1,
        default: width,
      },
      {
        name: 'w2',
        value: 25,
        min: 0,
        max: 1000,
        step: 1,
        default: 25,
      },
    ],
    globalParams: [
      {
        name: '字重',
        value: 40,
        min: 0,
        max: 100,
        step: 1,
        default: 40,
      },
    ],
  },
  {
    name: 'b',
    params: [
      {
        name: 'h1',
        value: capitalHeight,
        min: 0,
        max: 1000,
        step: 1,
        default: capitalHeight,
      },
      {
        name: 'h2',
        value: capitalHeight * 290 / 750,
        min: 0,
        max: 1000,
        step: 1,
        default: capitalHeight * 290 / 750,
      },
      {
        name: 'h3',
        value: 98,
        min: 0,
        max: 1000,
        step: 1,
        default: 98,
      },
      {
        name: 'w1',
        value: width,
        min: 0,
        max: 1000,
        step: 1,
        default: width,
      },
      {
        name: 'w2',
        value: 82,
        min: 0,
        max: 1000,
        step: 1,
        default: 82,
      },
    ],
    globalParams: [
      {
        name: '字重',
        value: 40,
        min: 0,
        max: 100,
        step: 1,
        default: 40,
      },
    ],
  },
  {
    name: 'c',
    params: [
      {
        name: 'h1',
        value: xHeight,
        min: 0,
        max: 1000,
        step: 1,
        default: xHeight,
      },
      {
        name: 'h2',
        value: 125,
        min: 0,
        max: 1000,
        step: 1,
        default: 125,
      },
      {
        name: 'w1',
        value: width,
        min: 0,
        max: 1000,
        step: 1,
        default: width,
      },
    ],
    globalParams: [
      {
        name: '字重',
        value: 40,
        min: 0,
        max: 100,
        step: 1,
        default: 40,
      },
    ],
  },
  {
    name: 'd',
    params: [
      {
        name: 'h1',
        value: capitalHeight,
        min: 0,
        max: 1000,
        step: 1,
        default: capitalHeight,
      },
      {
        name: 'h2',
        value: capitalHeight * 290 / 750,
        min: 0,
        max: 1000,
        step: 1,
        default: capitalHeight * 290 / 750,
      },
      {
        name: 'h3',
        value: 98,
        min: 0,
        max: 1000,
        step: 1,
        default: 98,
      },
      {
        name: 'w1',
        value: width,
        min: 0,
        max: 1000,
        step: 1,
        default: width,
      },
      {
        name: 'w2',
        value: 82,
        min: 0,
        max: 1000,
        step: 1,
        default: 82,
      },
    ],
    globalParams: [
      {
        name: '字重',
        value: 40,
        min: 0,
        max: 100,
        step: 1,
        default: 40,
      },
    ],
  },
  {
    name: 'e',
    params: [
      {
        name: 'h1',
        value: xHeight,
        min: 0,
        max: 1000,
        step: 1,
        default: xHeight,
      },
      {
        name: 'h2',
        value: 135,
        min: 0,
        max: 1000,
        step: 1,
        default: 135,
      },
      {
        name: 'w1',
        value: width,
        min: 0,
        max: 1000,
        step: 1,
        default: width,
      },
    ],
    globalParams: [
      {
        name: '字重',
        value: 40,
        min: 0,
        max: 100,
        step: 1,
        default: 40,
      },
    ],
  },
  {
    name: 'f',
    params: [
      {
        name: 'h1',
        value: capitalHeight,
        min: 0,
        max: 1000,
        step: 1,
        default: capitalHeight,
      },
      {
        name: 'h2',
        value: capitalHeight * 250 / 750,
        min: 0,
        max: 1000,
        step: 1,
        default: capitalHeight * 250 / 750,
      },
      {
        name: 'h3',
        value: 100,
        min: 0,
        max: 1000,
        step: 1,
        default: 100,
      },
      {
        name: 'w1',
        value: width,
        min: 0,
        max: 1000,
        step: 1,
        default: width,
      },
    ],
    globalParams: [
      {
        name: '字重',
        value: 40,
        min: 0,
        max: 100,
        step: 1,
        default: 40,
      },
    ],
  },
  {
    name: 'g',
    params: [
      {
        name: 'h1',
        value: xHeight - descender,
        min: 0,
        max: 1000,
        step: 1,
        default: xHeight - descender,
      },
      {
        name: 'h2',
        value: (xHeight - descender) * 395 / 700,
        min: 0,
        max: 1000,
        step: 1,
        default: (xHeight - descender) * 395 / 700,
      },
      {
        name: 'h3',
        value: 135,
        min: 0,
        max: 1000,
        step: 1,
        default: 135,
      },
      {
        name: 'h4',
        value: (xHeight - descender) * 0.2,
        min: 0,
        max: 1000,
        step: 1,
        default: (xHeight - descender) * 0.2,
      },
      {
        name: 'h5',
        value: (xHeight - descender) * 0.2,
        min: 0,
        max: 1000,
        step: 1,
        default: (xHeight - descender) * 0.2,
      },
      {
        name: 'w1',
        value: width,
        min: 0,
        max: 1000,
        step: 1,
        default: width,
      },
    ],
    globalParams: [
      {
        name: '字重',
        value: 40,
        min: 0,
        max: 100,
        step: 1,
        default: 40,
      },
    ],
  },
  {
    name: 'h',
    params: [
      {
        name: 'h1',
        value: capitalHeight,
        min: 0,
        max: 1000,
        step: 1,
        default: capitalHeight,
      },
      {
        name: 'h2',
        value: 175,
        min: 0,
        max: 1000,
        step: 1,
        default: 175,
      },
      {
        name: 'h3',
        value: capitalHeight * 480 / 750,
        min: 0,
        max: 1000,
        step: 1,
        default: capitalHeight * 480 / 750,
      },
      {
        name: 'w1',
        value: width,
        min: 0,
        max: 1000,
        step: 1,
        default: width,
      },
    ],
    globalParams: [
      {
        name: '字重',
        value: 40,
        min: 0,
        max: 100,
        step: 1,
        default: 40,
      },
    ],
  },
  {
    name: 'i',
    params: [
      {
        name: 'h1',
        value: capitalHeight,
        min: 0,
        max: 1000,
        step: 1,
        default: capitalHeight,
      },
      {
        name: 'h2',
        value: 130,
        min: 0,
        max: 1000,
        step: 1,
        default: 150,
      },
    ],
    globalParams: [
      {
        name: '字重',
        value: 40,
        min: 0,
        max: 100,
        step: 1,
        default: 40,
      },
    ],
  },
  {
    name: 'j',
    params: [
      {
        name: 'h1',
        value: capitalHeight - descender,
        min: 0,
        max: 1000,
        step: 1,
        default: capitalHeight - descender,
      },
      {
        name: 'h2',
        value: 150,
        min: 0,
        max: 1000,
        step: 1,
        default: 150,
      },
      {
        name: 'h3',
        value: 80,
        min: 0,
        max: 1000,
        step: 1,
        default: 80,
      },
      {
        name: 'h4',
        value: (capitalHeight - descender) * 0.75,
        min: 0,
        max: 1000,
        step: 1,
        default: (capitalHeight - descender) * 0.75,
      },
      {
        name: 'w1',
        value: width / 2,
        min: 0,
        max: 1000,
        step: 1,
        default: width / 2,
      },
    ],
    globalParams: [
      {
        name: '字重',
        value: 40,
        min: 0,
        max: 100,
        step: 1,
        default: 40,
      },
    ],
  },
  {
    name: 'k',
    params: [
      {
        name: 'h1',
        value: capitalHeight,
        min: 0,
        max: 1000,
        step: 1,
        default: capitalHeight,
      },
      {
        name: 'h2',
        value: 185,
        min: 0,
        max: 1000,
        step: 1,
        default: 185,
      },
      {
        name: 'h3',
        value: capitalHeight * 460 / 750,
        min: 0,
        max: 1000,
        step: 1,
        default: capitalHeight * 460 / 750,
      },
      {
        name: 'h4',
        value: capitalHeight * 383 / 750,
        min: 0,
        max: 1000,
        step: 1,
        default: capitalHeight * 383 / 750,
      },
      {
        name: 'w1',
        value: width,
        min: 0,
        max: 1000,
        step: 1,
        default: width,
      },
      {
        name: 'w2',
        value: 120,
        min: 0,
        max: 1000,
        step: 1,
        default: 120,
      },
    ],
    globalParams: [
      {
        name: '字重',
        value: 40,
        min: 0,
        max: 100,
        step: 1,
        default: 40,
      },
    ],
  },
  {
    name: 'l',
    params: [
      {
        name: 'h1',
        value: capitalHeight,
        min: 0,
        max: 1000,
        step: 1,
        default: capitalHeight,
      },
    ],
    globalParams: [
      {
        name: '字重',
        value: 40,
        min: 0,
        max: 100,
        step: 1,
        default: 40,
      },
    ],
  },
  {
    name: 'm',
    params: [
      {
        name: 'h1',
        value: xHeight,
        min: 0,
        max: 1000,
        step: 1,
        default: xHeight,
      },
      {
        name: 'h2',
        value: 150,
        min: 0,
        max: 1000,
        step: 1,
        default: 165,
      },
      {
        name: 'w1',
        value: width * 2,
        min: 0,
        max: 1000,
        step: 1,
        default: width * 2,
      },
    ],
    globalParams: [
      {
        name: '字重',
        value: 40,
        min: 0,
        max: 100,
        step: 1,
        default: 40,
      },
    ],
  },
  {
    name: 'n',
    params: [
      {
        name: 'h1',
        value: xHeight,
        min: 0,
        max: 1000,
        step: 1,
        default: xHeight,
      },
      {
        name: 'h2',
        value: 165,
        min: 0,
        max: 1000,
        step: 1,
        default: 150,
      },
      {
        name: 'w1',
        value: width,
        min: 0,
        max: 1000,
        step: 1,
        default: width,
      },
    ],
    globalParams: [
      {
        name: '字重',
        value: 40,
        min: 0,
        max: 100,
        step: 1,
        default: 40,
      },
    ],
  },
  {
    name: 'o',
    params: [
      {
        name: 'h1',
        value: xHeight,
        min: 0,
        max: 1000,
        step: 1,
        default: xHeight,
      },
      {
        name: 'w1',
        value: width,
        min: 0,
        max: 1000,
        step: 1,
        default: width,
      },
    ],
    globalParams: [
      {
        name: '字重',
        value: 40,
        min: 0,
        max: 100,
        step: 1,
        default: 40,
      },
    ],
  },
  {
    name: 'p',
    params: [
      {
        name: 'h1',
        value: xHeight - descender,
        min: 0,
        max: 1000,
        step: 1,
        default: xHeight - descender,
      },
      {
        name: 'h2',
        value: 115,
        min: 0,
        max: 1000,
        step: 1,
        default: 115,
      },
      {
        name: 'h3',
        value: (xHeight - descender) * 300 / 700,
        min: 0,
        max: 1000,
        step: 1,
        default: (xHeight - descender) * 300 / 700,
      },
      {
        name: 'w1',
        value: width,
        min: 0,
        max: 1000,
        step: 1,
        default: width,
      },
      {
        name: 'w2',
        value: 45,
        min: 0,
        max: 1000,
        step: 1,
        default: 45,
      },
    ],
    globalParams: [
      {
        name: '字重',
        value: 40,
        min: 0,
        max: 100,
        step: 1,
        default: 40,
      },
    ],
  },
  {
    name: 'q',
    params: [
      {
        name: 'h1',
        value: xHeight - descender,
        min: 0,
        max: 1000,
        step: 1,
        default: xHeight - descender,
      },
      {
        name: 'h2',
        value: 115,
        min: 0,
        max: 1000,
        step: 1,
        default: 115,
      },
      {
        name: 'h3',
        value: (xHeight - descender) * 300 / 700,
        min: 0,
        max: 1000,
        step: 1,
        default: (xHeight - descender) * 300 / 700,
      },
      {
        name: 'w1',
        value: width,
        min: 0,
        max: 1000,
        step: 1,
        default: width,
      },
      {
        name: 'w2',
        value: 45,
        min: 0,
        max: 1000,
        step: 1,
        default: 45,
      },
    ],
    globalParams: [
      {
        name: '字重',
        value: 40,
        min: 0,
        max: 100,
        step: 1,
        default: 40,
      },
    ],
  },
  {
    name: 'r',
    params: [
      {
        name: 'h1',
        value: xHeight,
        min: 0,
        max: 1000,
        step: 1,
        default: xHeight,
      },
      {
        name: 'h2',
        value: xHeight * 275 / 500,
        min: 0,
        max: 1000,
        step: 1,
        default: xHeight * 275 / 500,
      },
      {
        name: 'w1',
        value: width * 0.7,
        min: 0,
        max: 1000,
        step: 1,
        default: width * 0.7,
      },
    ],
    globalParams: [
      {
        name: '字重',
        value: 40,
        min: 0,
        max: 100,
        step: 1,
        default: 40,
      },
    ],
  },
  {
    name: 's',
    params: [
      {
        name: 'h1',
        value: xHeight,
        min: 0,
        max: 1000,
        step: 1,
        default: xHeight,
      },
      {
        name: 'h2',
        value: 80,
        min: 0,
        max: 1000,
        step: 1,
        default: 80,
      },
      {
        name: 'w1',
        value: width,
        min: 0,
        max: 1000,
        step: 1,
        default: width,
      },
    ],
    globalParams: [
      {
        name: '字重',
        value: 40,
        min: 0,
        max: 100,
        step: 1,
        default: 40,
      },
    ],
  },
  {
    name: 't',
    params: [
      {
        name: 'h1',
        value: capitalHeight,
        min: 0,
        max: 1000,
        step: 1,
        default: capitalHeight,
      },
      {
        name: 'h2',
        value: capitalHeight * 250 / 750,
        min: 0,
        max: 1000,
        step: 1,
        default: capitalHeight * 250 / 750,
      },
      {
        name: 'h3',
        value: 100,
        min: 0,
        max: 1000,
        step: 1,
        default: 100,
      },
      {
        name: 'h4',
        value: 100,
        min: 0,
        max: 1000,
        step: 1,
        default: 100,
      },
      {
        name: 'w1',
        value: width,
        min: 0,
        max: 1000,
        step: 1,
        default: width,
      },
    ],
    globalParams: [
      {
        name: '字重',
        value: 40,
        min: 0,
        max: 100,
        step: 1,
        default: 40,
      },
    ],
  },
  {
    name: 'u',
    params: [
      {
        name: 'h1',
        value: xHeight,
        min: 0,
        max: 1000,
        step: 1,
        default: xHeight,
      },
      {
        name: 'h2',
        value: 185,
        min: 0,
        max: 1000,
        step: 1,
        default: 185,
      },
      {
        name: 'w1',
        value: width,
        min: 0,
        max: 1000,
        step: 1,
        default: width,
      },
    ],
    globalParams: [
      {
        name: '字重',
        value: 40,
        min: 0,
        max: 100,
        step: 1,
        default: 40,
      },
    ],
  },
  {
    name: 'v',
    params: [
      {
        name: 'h1',
        value: xHeight,
        min: 0,
        max: 1000,
        step: 1,
        default: xHeight,
      },
      {
        name: 'w1',
        value: width,
        min: 0,
        max: 1000,
        step: 1,
        default: width,
      },
    ],
    globalParams: [
      {
        name: '字重',
        value: 40,
        min: 0,
        max: 100,
        step: 1,
        default: 40,
      },
    ],
  },
  {
    name: 'w',
    params: [
      {
        name: 'h1',
        value: xHeight,
        min: 0,
        max: 1000,
        step: 1,
        default: xHeight,
      },
      {
        name: 'w1',
        value: width * 2,
        min: 0,
        max: 1000,
        step: 1,
        default: width * 2,
      },
    ],
    globalParams: [
      {
        name: '字重',
        value: 40,
        min: 0,
        max: 100,
        step: 1,
        default: 40,
      },
    ],
  },
  {
    name: 'x',
    params: [
      {
        name: 'h1',
        value: xHeight,
        min: 0,
        max: 1000,
        step: 1,
        default: xHeight,
      },
      {
        name: 'w1',
        value: width,
        min: 0,
        max: 1000,
        step: 1,
        default: width,
      },
    ],
    globalParams: [
      {
        name: '字重',
        value: 40,
        min: 0,
        max: 100,
        step: 1,
        default: 40,
      },
    ],
  },
  {
    name: 'y',
    params: [
      {
        name: 'h1',
        value: xHeight - descender,
        min: 0,
        max: 1000,
        step: 1,
        default: xHeight - descender,
      },
      {
        name: 'h2',
        value: (xHeight - descender) * 445 / 700,
        min: 0,
        max: 1000,
        step: 1,
        default: (xHeight - descender) * 445 / 700,
      },
      {
        name: 'w1',
        value: width,
        min: 0,
        max: 1000,
        step: 1,
        default: width,
      },
      {
        name: 'w2',
        value: 135,
        min: 0,
        max: 1000,
        step: 1,
        default: 135,
      },
      {
        name: 'w3',
        value: width * 320 / 360,
        min: 0,
        max: 1000,
        step: 1,
        default: width * 320 / 360,
      },
    ],
    globalParams: [
      {
        name: '字重',
        value: 40,
        min: 0,
        max: 100,
        step: 1,
        default: 40,
      },
    ],
  },
  {
    name: 'z',
    params: [
      {
        name: 'h1',
        value: xHeight,
        min: 0,
        max: 1000,
        step: 1,
        default: xHeight,
      },
      {
        name: 'w1',
        value: width,
        min: 0,
        max: 1000,
        step: 1,
        default: width,
      },
    ],
    globalParams: [
      {
        name: '字重',
        value: 40,
        min: 0,
        max: 100,
        step: 1,
        default: 40,
      },
    ],
  },
]

lowercaseLetters = lowercaseLetters.map((letter) => {
  letter.globalParams.push({
    name: '衬线类型',
    // @ts-ignore
    type: ParameterType.Enum,
    value: 1,
    default: 1,
    options: [
      {
        value: 0,
        label: '无衬线',
      },
      {
        value: 1,
        label: '衬线类型1',
      },
    ]
  })
  letter.globalParams.push({
    name: '衬线大小',
    // @ts-ignore
    type: ParameterType.Number,
    value: 2.0,
    min: 1.0,
    max: 3.0,
    step: 0.1,
    default: 2.0,
  })
  return letter
})

export {
  lowercaseLetters,
}